package com.wdc.controller;



import com.wdc.entity.po.UserBeautyInfo;
import com.wdc.entity.query.UserBeautyInfoQuery;
import com.wdc.entity.vo.ResponseVo;
import com.wdc.service.UserBeautyInfoService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



import javax.annotation.Resource;
import java.util.List;

/**
 * @author: WDC
 * @description:Controller
 * @date:2024/09/09
 */
@RestController
@RequestMapping("/userBeautyInfo")
public class UserBeautyInfoController extends ABaseController {


	@Resource
	private UserBeautyInfoService userBeautyInfoService;

	@RequestMapping("/loadDataList")
	public ResponseVo loadDataList(UserBeautyInfoQuery query) {
		return getSuccessResponseVo(userBeautyInfoService.findListByPage(query));
	}

	/**
	 * 新增
	 */
	@RequestMapping("/add")
	public ResponseVo add(UserBeautyInfo bean) {
		this.userBeautyInfoService.add(bean);
		return getSuccessResponseVo(null);
	}

	/**
	 * 批量新增
	 */
	@RequestMapping("/addBatch")
	public ResponseVo addBatch(@RequestBody List<UserBeautyInfo> listBean) {
		this.userBeautyInfoService.addBatch(listBean);
		return getSuccessResponseVo(null);
	}

	/**
	 * 批量新增或修改
	 */
	@RequestMapping("/addOrUpdateBatch")
	public ResponseVo addOrUpdateBatch(@RequestBody List<UserBeautyInfo> listBean) {
		this.userBeautyInfoService.addOrUpdateBatch(listBean);
		return getSuccessResponseVo(null);
	}
	/**
	 * 根据Id查询
	 */
	@RequestMapping("/getUserBeautyInfoById")
	public ResponseVo getUserBeautyInfoById(Integer id) {
		return getSuccessResponseVo(this.userBeautyInfoService.getUserBeautyInfoById(id));
	}

	/**
	 * 根据Id更新
	 */
	@RequestMapping("/updateUserBeautyInfoById")
	public ResponseVo updateUserBeautyInfoById(UserBeautyInfo bean, Integer id) {
		 this.userBeautyInfoService.updateUserBeautyInfoById(bean, id);
		return getSuccessResponseVo(null);
	}

	/**
	 * 根据Id删除
	 */
	@RequestMapping("/deleteUserBeautyInfoById")
	public ResponseVo deleteUserBeautyInfoById(Integer id) {
		 this.userBeautyInfoService.deleteUserBeautyInfoById(id);
		return getSuccessResponseVo(null);
	}

	/**
	 * 根据UserId查询
	 */
	@RequestMapping("/getUserBeautyInfoByUserId")
	public ResponseVo getUserBeautyInfoByUserId(String userId) {
		return getSuccessResponseVo(this.userBeautyInfoService.getUserBeautyInfoByUserId(userId));
	}

	/**
	 * 根据UserId更新
	 */
	@RequestMapping("/updateUserBeautyInfoByUserId")
	public ResponseVo updateUserBeautyInfoByUserId(UserBeautyInfo bean, String userId) {
		 this.userBeautyInfoService.updateUserBeautyInfoByUserId(bean, userId);
		return getSuccessResponseVo(null);
	}

	/**
	 * 根据UserId删除
	 */
	@RequestMapping("/deleteUserBeautyInfoByUserId")
	public ResponseVo deleteUserBeautyInfoByUserId(String userId) {
		 this.userBeautyInfoService.deleteUserBeautyInfoByUserId(userId);
		return getSuccessResponseVo(null);
	}

	/**
	 * 根据Email查询
	 */
	@RequestMapping("/getUserBeautyInfoByEmail")
	public ResponseVo getUserBeautyInfoByEmail(String email) {
		return getSuccessResponseVo(this.userBeautyInfoService.getUserBeautyInfoByEmail(email));
	}

	/**
	 * 根据Email更新
	 */
	@RequestMapping("/updateUserBeautyInfoByEmail")
	public ResponseVo updateUserBeautyInfoByEmail(UserBeautyInfo bean, String email) {
		 this.userBeautyInfoService.updateUserBeautyInfoByEmail(bean, email);
		return getSuccessResponseVo(null);
	}

	/**
	 * 根据Email删除
	 */
	@RequestMapping("/deleteUserBeautyInfoByEmail")
	public ResponseVo deleteUserBeautyInfoByEmail(String email) {
		 this.userBeautyInfoService.deleteUserBeautyInfoByEmail(email);
		return getSuccessResponseVo(null);
	}

}